package com.syni.mdd.sjb.common.component.utils.feign.service.mdd.commonuser;

import com.syni.mdd.sjb.common.component.utils.common.utils.ParamsMap;
import com.syni.mdd.sjb.common.component.utils.common.utils.RpcResponseVo;
import com.syni.mdd.sjb.common.component.utils.feign.constants.Constants;
import com.syni.mdd.sjb.common.component.utils.feign.dto.mddAll.apiUser.GetIdentifyingCodeDto;
import com.syni.mdd.sjb.common.component.utils.feign.dto.mddUser.apiUser.GetMidongdongUserDto;
import com.syni.mdd.sjb.common.component.utils.feign.dto.mddUser.apiUser.GetOneTimeTokenDto;
import com.syni.mdd.sjb.common.component.utils.feign.dto.mddUser.apiUser.GetSyniTokenDto;
import com.syni.mdd.sjb.common.component.utils.feign.dto.mddUser.apiUser.GetUserBasisDto;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @className UserRestService
 * @description TOO
 * @Author cfx
 * @DATE 2020/4/20 14:17
 * @VERSION 1.0
 **/
@FeignClient(value = Constants.MDD_COMMON_USER,path = Constants.MDD_COMMON_USER_PATH)
@RequestMapping("/apiUser")
public interface UserRestService {
    @PostMapping("/checkUserIdentity")
    boolean checkUserIdentity(@RequestBody ParamsMap paramsMap);

    @PostMapping("/checkZuulIntoUser")
    RpcResponseVo checkZuulIntoUser(@RequestParam("token") String token);

    @PostMapping("/registerDxshAppUser")
    RpcResponseVo registerDxshAppUser(@RequestParam("phone") String phone,
                                      @RequestParam("verificationCode") String verificationCode,
                                      @RequestParam("password") String password);

    @PostMapping("/registerDataBankUser")
    RpcResponseVo registerDataBankUser(@RequestParam("phone") String phone,
                                      @RequestParam("password") String password,
                                       @RequestParam(value = "thirdPartyChannel",required = false) Integer thirdPartyChannel);
    @PostMapping("/loginDxshAppUser")
    RpcResponseVo loginDxshAppUser(@RequestParam("phone") String phone,
                        @RequestParam("loginWay") Integer loginWay,
                        @RequestParam("loginBody") String loginBody);

    @PostMapping("/loginDataBankUser")
    RpcResponseVo loginDataBankUser(@RequestParam("phone") String phone,
                                    @RequestParam("loginWay") Integer loginWay,
                                    @RequestParam("loginBody") String loginBody);

    @PostMapping("/loginDataBankUserByChannel")
    RpcResponseVo loginDataBankUserByChannel(@RequestParam("phone") String phone,
                                    @RequestParam("loginWay") Integer loginWay,
                                    @RequestParam("loginBody") String loginBody,
                                     @RequestParam(value = "thirdPartyChannel",required = false) Integer thirdPartyChannel);

    @PostMapping("/forgetDxshAppUser")
    RpcResponseVo forgetDxshAppUser(@RequestParam("phone") String phone,
                         @RequestParam("verificationCode") String verificationCode,
                         @RequestParam("password") String password);
    @PostMapping("/getIdentifyingCode")
    RpcResponseVo getIdentifyingCode(@RequestBody GetIdentifyingCodeDto getIdentifyingCodeDto);

    @PostMapping("/getUserInfo")
    RpcResponseVo getUserInfo(@RequestParam("userId") Integer userId);

    @GetMapping("/getUserInfoByPhone")
    RpcResponseVo getUserInfoByPhone(@RequestParam("phone") String phone);

    @PostMapping("/saveUserInfo")
    RpcResponseVo saveUserInfo(@RequestParam("userId") Integer userId, @RequestParam("headImg") String headImg,
                               @RequestParam("surName") String surName, @RequestParam("name") String name,
                               @RequestParam("sex") Integer sex, @RequestParam("age") Integer age);
    @PostMapping("/modifyPwd")
    RpcResponseVo modifyPwd(@RequestParam("userId") Integer userId, @RequestParam("verificationCode") String verificationCode,
                            @RequestParam("newPwd") String newPwd);

    /**
     * @Description 根据电享生活app小程序token获取userId
     * @Param token
     * @Author: cfx
     * @Date: 2020/5/6
     */
    @GetMapping("/getUserIdByMiniToken")
    RpcResponseVo getUserIdByMiniToken(@RequestParam("token") String token);

    /**
     * @Description 根据userId获取电享生活app小程序token
     * @Param userId
     * @Author: lcc
     * @Date: 2020/5/7
     */
    @GetMapping("/getMiniTokenByUserId")
    RpcResponseVo getMiniTokenByUserId(@RequestParam("userId") Integer userId);

    @GetMapping("/getMiniTokenByUserId/v2")
    RpcResponseVo getMiniTokenByUserId_v2(@RequestParam("userId") Integer userId,@RequestParam("token") String token);

    @PostMapping("/getMidongdongUser")
    RpcResponseVo getMidongdongUser(@RequestBody GetMidongdongUserDto getMidongdongUserDto);

    @PostMapping("/getUserBasisByUserId")
    RpcResponseVo getUserBasisByUserId(@RequestBody GetUserBasisDto getUserBasisDto) ;

    @PostMapping("/singleLogin")
    RpcResponseVo singleLogin(@RequestBody GetSyniTokenDto getUserBasisDto) ;

    @PostMapping("/getOneTimeToken")
    RpcResponseVo getOneTimeToken(@RequestBody GetOneTimeTokenDto getOneTimeTokenDto) ;

    @PostMapping("/forceLogout")
    RpcResponseVo forceLogout(@RequestParam("user") String user,
                              @RequestParam("role") Integer role,
                              @RequestParam("client") Integer client);

    @PostMapping("/forceBusinessUserLogout")
    RpcResponseVo forceBusinessUserLogout(@RequestParam("user") String user,
                                          @RequestParam("businessId") Integer businessId,
                                          @RequestParam("assistantIds") String assistantIds);

    @GetMapping("/dxshMinAppUserLoginByPhone")
    RpcResponseVo dxshMinAppUserLoginByPhone(@RequestParam("phone") String phone);

    @GetMapping("/checkVerificationCode")
    RpcResponseVo checkVerificationCode(@RequestParam("phone") String phone,@RequestParam("verificationCode") String verificationCode,
                                        @RequestParam("codeType") Integer codeType);

    @GetMapping("/getMinAppCallToken")
    RpcResponseVo getMinAppCallToken(@RequestParam("userId") Integer userId);

    @PostMapping("/getAccountIdsByUserIds")
    RpcResponseVo getAccountIdsByUserIds(@RequestParam("userIds") List<Integer> userIds);

    @GetMapping("/checkDxshUserPwd")
    RpcResponseVo checkDxshUserPwd(@RequestParam("phone") String phone, @RequestParam("pwd") String pwd);

    //RpcResponseVo getUserDataByToken(String token);
}
